package com.hz.ruoyistorage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hz.ruoyistorage.domain.mypojo.LgGoodsSome;
import com.hz.ruoyistorage.mapper.LgGoodsSomeMapper;
import com.hz.ruoyistorage.service.LgGoodsSomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @version 1.0
 * @Author gj
 * @Date 2025/3/10 16:02
 * @注释
 */
@Service
public class LgGoodsSomeServiceImpl
        extends ServiceImpl<LgGoodsSomeMapper, LgGoodsSome>
        implements LgGoodsSomeService {
    @Autowired
    private LgGoodsSomeMapper lgGoodsSomeMapper;

    @Override
    public List<LgGoodsSome> getParent() {
        return lgGoodsSomeMapper.getParent();
    }

    @Override
    public List<LgGoodsSome> getChild(Map<String, Object> query)
    {
        Integer firstNum = (Integer) query.get("pageNum");
        Integer secondNum = (Integer) query.get("pageSize");
        if(firstNum!=null&&secondNum!=null){
            query.put("firstNum",(firstNum-1)*secondNum);
            query.put("secondNum",secondNum);
        }
        return lgGoodsSomeMapper.getChild(query);
    }
}
